/******************************init****************************/
function querySettledApply(page) {
	var parm = $('#querySettledApplyForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('settledapply-query');
	sys_record_parm('settledapply',parm);
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}

function deleteSettledApply(code) {
	$.Zebra_Dialog('是否删除',{
	'type': 'question',
	'title': '警告' ,
	'buttons':[
	           {caption:'删除',callback:function() {
	        	    var url = create_url('settledapply-delete');
					settledApply_aidExecute(code, url);
	    		}},
	           {caption:'取消',callback:function(){}
	    	}]
	});
}

function settledApply_aidExecute(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功');
				querySettledApply();
			} else {
				sys_msg('操作失败');
				querySettledApply();
			}
		}
	});
}


function aidQueryDetail(code){
	var url = create_url('settledapply-aidDetail');
	var parm = {"code": code};
	$.colorbox({overlayClose:false, href:url, data:parm, close:'[关闭]', width:'750px',height:'500px', open:true});
}

function addNewOrgan(code){
	$.fn.colorbox.close();
	sys_load_handle('settledapply-edit_'+code);
}
